package com.qing.design.patterns.state.example.demo2;

import com.qing.design.patterns.state.example.demo2.activity.ActivityService;
import com.qing.design.patterns.state.example.demo2.activity.Result;
import com.qing.design.patterns.state.example.demo2.activity.StateHandler;
import com.qing.design.patterns.state.example.demo2.activity.Status;

public class Demo {
    public static void main(String[] args) {
        String activityId="100001";
        ActivityService.init(activityId, Status.Editing);

        StateHandler stateHandler=new StateHandler();
        //活动审批
        Result result=stateHandler.arraignment(activityId,Status.Editing);

        System.out.println(result);
        //活动关闭
         result=stateHandler.close(activityId,Status.Editing);

        System.out.println(result);
        System.out.println(ActivityService.getActivityInfo(activityId).toString());
    }
}
